-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX] Contracts stored in state not being updated #1463
Conversation
…ovider - Saves only addresses to state
- uses useSafeContracts directly instead of global state to get base contracts
✅ Deploy Preview for fractal-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately I did my best to keep this at min changes possible. I didn't want to change any current data flow or typing unless I absolutely have to
I left two TODOs in fractal.ts
, to spin off from this and update the other places we are doing this (Freeze contracts and TokenClaim Contract). I may do this shortly after this PR once this gets the okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work here @Da-Colon!
I've left a bunch of comments / questions / concerns.
Feel free to "resolve" any comments that are just my own ramblings and questions/answers, which don't need a response.
There are some review comments that are questions that I would like a response to.
There are some review comments that call out places that I think are inadvertent mistakes that might need to be fixed.
- the else was out of place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Giving an approval to this PR after having extensively reviewed and questioned the code, but with the caveat that I have not actually tested the runtime behavior of these changes.
Hoping that others on the team can do some functional testing.
See link here for why I approved - https://discord.com/channels/839548879216181309/1219322243310555277/1219332979760042045 |
I'll explain some of the code changes in a review, But basically two things in this PR
Fixes contracts
asSigner
not properly being stored in stateAs a DAO is loaded and stored in state in
useGovernanaceContracts
, the wallet provider may not be connect to a user's wallet yet and the contract'sasSigner
was being connected via aFallbackProvider
and would not update when the user's connection status settles.This bug shows it self when attempting to vote and executing.
The Fix
Remove storing Contracts in state. I thought of a few things I could ultimately do, but the best thing was to just save the retrieved address instead state (keeping the basic workflow the same) and as needed, attach the address to the appropriate contract.
Testing
Refreshing on the details screen, when there is a actionable thing to do is best way to show this bug. Take same proposal to
https://app.dev.fractalframework.xyz/ to see this bug.
Closes #1461